<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<style>
    .readonly{cursor: not-allowed}
</style>
<link rel="stylesheet" href="/css/certificateWeb/stationApplyFor/stationApplyFor.css">
<body id="body">
<style>
    .line{text-align: center;border-bottom: 1px solid #CFCFCF;clear: both;margin-top: 20px}
    .span_1 {width: 180px}
    .cd{
        width: 130px;display: inline-block;margin: 20px auto auto auto;
    }
    .dong{
        width: 55px;display: inline-block;margin: 20px auto auto auto;
    }
    .jshi{
        width: 55px;display: inline-block;margin: 20px auto auto auto;
    }
    .addBtn{
        width: 440px;height: 35px;background-color: #dddee1;border-radius: 3px;margin: 20px auto 20px 95px;
        color: #515c34;font-weight: bold;border: 0px;
    }
    .del{
        width: 55px; color: #00b7ee; background-color: #dddee1;margin-left: 15px;display: inline-block;
        border-radius:3px;text-align: center;font-size: 16px;line-height: 25px;margin-top: 34px;
    }
</style>
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li class="this"><a href="/certificate/my">个人信息</a></li>
                <!-- <li><a href="/certificate/findApplyExam">报名记录</a></li> -->
                <li><a href="/certificate/infoRecordList">表单提交记录</a></li>
                <li><a href="/certificate/expertRecordList">专家申请记录</a></li>
                <li><a href="/certificate/stationRecordList">考核站点申请记录</a></li>
                <li><a href="/certificate/stationPxRecordList">培训基地申请记录</a></li>
                <li><a href="/certificate/gradeQuery">成绩查询</a></li>
                <li><a href="/certificate/message">消息中心</a></li>
                <li><a href="/certificate/mock?grade=2" target="_blank">幼儿照护初级模拟考试</a></li>
                <li><a href="/certificate/mock?grade=1" target="_blank">幼儿照护中级模拟考试</a></li>
                <li><a href="/certificate/mock?grade=0" target="_blank">幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="div_2">
            <label class="label_title">机构信息—编辑机构信息</label>
            <input type="hidden" th:value="${org.id}" id="orgId"/>
            <span th:each="xz:${consultations}">
                <input type="hidden" id="cnsFile" th:value="${xz.files}" />
                <input type="hidden" id="cnTitle" th:value="${xz.title}" />
            </span>
            <hr/>

            <div id="info"></div>

        </div>
        <div style="clear: both"></div>
    </section>
</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
<script src="/js/plugins/validate/jquery.validate.extend.js"></script>
<script src="/js/jquery.citys.js"></script>
</body>
<script>
    $(function () {
        ajaxToken("/certificate/findOrgById", "Post", {orgId:$('#orgId').val()}, function (res) {
            var team = JSON.parse(res.team);
            var kptd = '';
            var sc1 = '';
            team.forEach(function (item, index) {
                if (team.length > 1){
                    if (index != 0){
                        sc1 = '<span class="del delkptd" id="delkptd">删除</span>';
                    }else {
                        sc1 = '';
                    }
                }
                kptd += '<div class="kptd">' +
                    '<div class="div_3">' +
                    '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text" placeholder="请输入姓名" value="'+item.khName+'" class="form-control inp_1 khName"/>' +sc1 +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="职称" value="'+item.jobName+'" class="form-control inp_1 jobName"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="职务" value="'+item.position+'" class="form-control inp_1 position"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="hidden" value="'+item.kpPost+'" id="kpPost" />'+
                    '                        <select class="form-control inp_1 kpPost">' +
                    '                            <option value="">请选择岗位</option>' +
                    '                            <option value="主任">主任</option>' +
                    '                            <option value="副主任">副主任</option>' +
                    '                            <option value="考务考评员">考务考评员</option>' +
                    '                            <option value="考务技术员">考务技术员</option>' +
                    '                        </select>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                        <input type="text"  placeholder="联系电话" value="'+item.kpMobile+'" class="form-control inp_1 kpMobile"/>' +
                    '                    </div>' +
                    '                    <div class="div_3">' +
                    '                        <label class="span_1">备注：</label>' +
                    '                        <input type="text"  placeholder="备注" value="'+item.kpRemark+'" class="form-control inp_1 kpRemark"/>' +
                    '                    </div>'+
                    '</div>';
            });
            //考评场地设备
            var equipment = JSON.parse(res.equipment);
            // console.log("站点数据：" , equipment);
            var kpcdsb = '';
            var sc2 = '';
            equipment.forEach(function (item, index) {
                if (equipment.length > 1){
                    if (index != 0){
                        sc2 = '<span class="del delkpcd" id="delkpcd">删除</span>';
                    }else {
                        sc2 = '';
                    }
                }
                kpcdsb += '<div class="kpcdsb">' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text" value="'+item.kpSite+'"  placeholder="场地"class="form-control inp_1 kpSite"/>' +sc2+
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="" value="'+item.college+'" class="form-control cd college"/>学院' +
                    '                    <input type="text"  placeholder="" value="'+item.ridgepole+'" class="form-control dong ridgepole"/>栋' +
                    '                    <input type="text"  placeholder="" value="'+item.classroomNum+'" class="form-control jshi classroomNum"/>号教室' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="设备及设施" value="'+item.equiAndFacility+'" class="form-control inp_1 equiAndFacility"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="说明" value="'+item.explain+'" class="form-control inp_1 explain"/>' +
                    '                </div>'+
                    '</div>';
            });

            //实习就业单位汇总
            var employer = JSON.parse(res.employer);
            // console.log("站点数据：" , employer);
            var sxjydw = '';
            var sc3 = '';
            employer.forEach(function (item, index) {
                if (employer.length > 1){
                    if (index != 0){
                        console.log("长度 = " , index);
                        sc3 = '<span class="del delsxjydw" id="delsxjydw">删除</span>';
                    }else {
                        sc3 = '';
                    }
                }
                sxjydw += '<div class="sxjydw">' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text" value="'+item.dwName+'"  placeholder="单位名称" class="form-control inp_1 dwName"/>' +sc3+
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="单位负责人" value="'+item.dwUser+'" class="form-control inp_1 dwUser"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="联系电话" value="'+item.dwMobile+'" class="form-control inp_1 dwMobile"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="实习就业负责人" value="'+item.jyUser+'" class="form-control inp_1 jyUser"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="联系电话" value="'+item.jyMobile+'" class="form-control inp_1 jyMobile"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="拟招聘人数" value="'+item.zpNum+'" class="form-control inp_1 zpNum"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="拟招聘岗位" value="'+item.zpPost+'" class="form-control inp_1 zpPost"/>' +
                    '                </div>' +
                    '                <div class="div_3">' +
                    '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
                    '                    <input type="text"  placeholder="薪酬" value="'+item.emolument+'" class="form-control inp_1 emolument"/>' +
                    '                </div>'+
                    '</div>';
            });
            var cnFile = $('#cnsFile').val();
            var cnTitle = $('#cnTitle').val();
            // console.log("承诺书 = " , cnFile ," + and " , cnTitle)
            var info = '<div class="line">考评基本情况</div>' +
                '            <div class="div_3">' +
                '                <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
                '                <input type="text" name="name" value="'+res.name+'" id="name" placeholder="请输入机构名称"' +
                '                       class="form-control inp_1"/>' +
                '            </div>' +
                /*'            <div class="div_3">' +
                '                <label class="span_1">考核站点名称<span style="color: #D52525">*</span>：</label>' +
                '                <input type="text" id="examPoint"  placeholder="请输入考核站点名称"' +
                '                       class="form-control inp_1"/>' +
                '            </div>' +*/
                '            <div class="div_3">' +
                '                <label class="span_1">已批准的考核计划(人)<span style="color: #D52525">*</span>：</label>' +
                '                <input type="number" id="numberOfExaminees" value="'+res.numberOfExaminees+'" placeholder="请输入已批准的考核计划(人)" name="numberOfExaminees"' +
                '                       class="form-control inp_1"/>' +
                '            </div>' +
                '            <div class="line">考评团队</div>' +
                '            <div id="kptd">' + kptd+'</div>' +
                '            <div>' +
                '                <span><input type="button" onclick="insert();" value="新增" class="addBtn" /></span>' +
                '            </div>' +
                '            <div class="line">考评场地设备</div>' +
                '            <div id="kpcdsb">'+kpcdsb+'</div>' +
                '            <div>' +
                '                <span><input type="button" onclick="insert1();" value="新增" class="addBtn" /></span>' +
                '            </div>' +
                '            <div class="line">实习就业单位汇总</div>' +
                '            <div id="sxjydw">' + sxjydw +'</div>' +
                '            <div>' +
                '                <span><input type="button" onclick="insert2();" value="新增" class="addBtn" /></span>' +
                '            </div>' +
                '            <div class="div_3">' +
                '                <label class="span_1">承诺书<span style="color: #D52525">*</span>：</label>' +
                '                <button type="button" class="btn inp_1" style="margin-top: 20px" id="btnUpload">' +
                '                    <i class="fa fa-cloud"></i>请盖章扫描后上传' +
                '                </button>' +
                '                <input type="text" value="'+res.enclosure+'" style="opacity:0;width: 1px;" id="enclosure" name="enclosure"/>' +
                '                <span id="test">'+subFileName(res.enclosure)+'</span>' +
                '            </div>' +
                '            <div class="div_3">' +
                '                <label class="span_1">承诺书模板下载：</label>' +
                '                <label style="height: 50px;float: left;margin: 20px 10px auto auto;font-size: 16px;line-height: 50px;">' +
                '                    <a target="_blank" href="'+cnFile+'" id="cnBook" style="color: blue" download>'+cnTitle+'</a>' +
                '                </label>' +
                '            </div>' +
                '            <div class="div_3">' +
                '                <label class="span_1">考核站点负责人个人签章<span style="color: #D52525">*</span>：</label>' +
                '                <button type="button" class="btn inp_1" style="margin-top: 20px" id="btnUpload1">' +
                '                    <i class="fa fa-cloud"></i>请上传背景透明的png格式图片' +
                '                </button>' +
                '                <input type="text" value="'+res.cachet+'"  style="opacity:0;width: 1px;" id="cachet" name="cachet"/>' +
                '                <span id="test1">'+subFileName(res.cachet)+'</span>' +
                '                <div style="clear: both"></div>' +
                '            </div>' +
                '            <div class="div_3">' +
                '                <button class="form-control but_1 send" type="button">提交审核</button>' +
                '                <button class="form-control but_1" onclick="saveCao()" type="button">保存草稿</button>'+
                '            </div>';
            $('#info').html(info);
            saveCao();
            $('.delkpcd').click(function () {
                $(this).parent('.div_3').parent('.kpcdsb').remove()
            })
            $('.delkptd').click(function () {
                $(this).parent('.div_3').parent('.kptd').remove()
            })
            $('.delsxjydw').click(function () {
                $(this).parent('.div_3').parent('.sxjydw').remove()
            })

            $('.send').click(function () {

                if ($('#name').val() == ""){
                    layer.msg("单位名称不能为空");
                    return false;
                }
                /*if ($('#examPoint').val() == ""){
                    layer.msg("考核站点名称不能为空");
                    return false;
                }*/
                if ($('#numberOfExaminees').val() == ""){
                    layer.msg("已批准的考核计划(人)不能为空");
                    return false;
                }
                if ($('#enclosure').val() == ""){
                    layer.msg("请上传承诺书");
                    return false;
                }
                if ($('#cachet').val() == ""){
                    layer.msg("请上传印章");
                    return false;
                }


                //------------------考评团队---------------------\\
                var teamList = [];
                var kptd = true;
                $(".kptd").each(function (item, index) {
                    var khName = $(this).find(".khName").val();
                    var jobName = $(this).find(".jobName").val();
                    var position = $(this).find('.position').val();
                    var kpPost = $(this).find('.kpPost').val();
                    var kpMobile = $(this).find('.kpMobile').val();
                    var kpRemark = $(this).find('.kpRemark').val();
                    if (khName == '' || jobName == '' || position == '' || kpPost == '' || kpMobile == '') {
                        layer.msg('考评团队信息填写不完整');
                        kptd = false;
                    }
                    teamList.push({khName: khName, jobName: jobName, position: position, kpPost:kpPost, kpMobile:kpMobile ,kpRemark:kpRemark});
                })
                if (kptd == false) {
                    return kptd;
                }
                //------------------考评场地设备---------------------\\
                var equipmentList = [];
                var kpcdsb = true;
                $(".kpcdsb").each(function (item, index) {
                    var kpSite = $(this).find(".kpSite").val();
                    var college = $(this).find(".college").val();
                    var ridgepole = $(this).find('.ridgepole').val();
                    var classroomNum = $(this).find('.classroomNum').val();
                    var equiAndFacility = $(this).find('.equiAndFacility').val();
                    var explain = $(this).find('.explain').val();
                    if (kpSite == '' || college == '' || ridgepole == '' || classroomNum == '' || equiAndFacility == '' || explain == '') {
                        layer.msg('考评场地设备信息填写不完整');
                        kpcdsb = false;
                    }
                    equipmentList.push({kpSite: kpSite, college: college, ridgepole: ridgepole, classroomNum:classroomNum, equiAndFacility:equiAndFacility ,explain:explain});
                })
                if (kpcdsb == false) {
                    return kpcdsb;
                }

                //------------------实习就业单位汇总---------------------\\
                var employerList = [];
                var sxjydw = true;
                $(".sxjydw").each(function (item, index) {
                    var dwName = $(this).find(".dwName").val();
                    var dwUser = $(this).find(".dwUser").val();
                    var dwMobile = $(this).find('.dwMobile').val();
                    var jyUser = $(this).find('.jyUser').val();
                    var jyMobile = $(this).find('.jyMobile').val();
                    var zpNum = $(this).find('.zpNum').val();
                    var zpPost = $(this).find('.zpPost').val();
                    var emolument = $(this).find('.emolument').val();
                    if (dwName == '' || dwUser == '' || dwMobile == '' || jyUser == '' || jyMobile == '' || zpNum == ''
                        || zpPost == '' || emolument == '') {
                        layer.msg('实习就业单位汇总信息填写不完整');
                        sxjydw = false;
                    }
                    employerList.push({dwName: dwName, dwUser: dwUser, dwMobile: dwMobile, jyUser:jyUser, jyMobile:jyMobile ,zpNum:zpNum, zpPost:zpPost, emolument:emolument});
                })
                if (sxjydw == false) {
                    return sxjydw;
                }
                ajaxToken("/certificate/saveStation", 'POST', {
                    orgId: $('#orgId').val(),
                    name:$('#name').val(),
                    numberOfExaminees:$('#numberOfExaminees').val(),
                    enclosure:$('#enclosure').val(),
                    cachet:$('#cachet').val(),
                    team:JSON.stringify(teamList),
                    equipment:JSON.stringify(equipmentList),
                    employer:JSON.stringify(employerList),
                    state:0
                }, function (r) {
                    location.href = "/certificate/stationRecordList";
                });
            })
            layui.use('upload', function () {
                var upload = layui.upload;
                //执行实例
                upload.render({
                    elem: '#btnUpload', //绑定元素
                    url: '/jzApi/utils/fileImprot', //上传接口
                    size: 1000,
                    accept: 'file',
                    done: function (r) {
                        $("#enclosure").val(r.data);
                        $("#test").html(subFileName(r.data));
                    },
                    error: function (r) {
                        layer.msg(r.msg);
                    }
                });
            });

            layui.use('upload', function () {
                var upload = layui.upload;
                //执行实例
                upload.render({
                    elem: '#btnUpload1', //绑定元素
                    url: '/jzApi/utils/fileImprot', //上传接口
                    size: 1000,
                    accept: 'images/*',
                    exts: 'png',
                    done: function (r) {
                        $("#cachet").val(r.data);
                        $("#test1").html(subFileName(r.data));
                    },
                    error: function (r) {
                        layer.msg(r.msg);
                    }
                });
            });
            $('.kpPost').val($('#kpPost').val())
        })
    })

    function insert(){
        $('#kptd').append('<div class="kptd">' +
            '<div class="div_3">' +
            '                        <label class="span_1">姓名<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text" placeholder="请输入姓名"' +
            '                               class="form-control inp_1 khName"/>' +
            '                    <span class="del" id="del">删除</span>'+
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">职称<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="职称"' +
            '                               class="form-control inp_1 jobName"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">职务<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="职务"' +
            '                               class="form-control inp_1 position"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">考评岗位<span style="color: #D52525">*</span>：</label>' +
            '                        <select class="form-control inp_1 kpPost">' +
            '                            <option value="">请选择岗位</option>' +
            '                            <option value="主任">主任</option>' +
            '                            <option value="副主任">副主任</option>' +
            '                            <option value="考务考评员">考务考评员</option>' +
            '                            <option value="考务技术员">考务技术员</option>' +
            '                        </select>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                        <input type="text"  placeholder="联系电话"' +
            '                               class="form-control inp_1 kpMobile"/>' +
            '                    </div>' +
            '                    <div class="div_3">' +
            '                        <label class="span_1">备注：</label>' +
            '                        <input type="text"  placeholder="备注"' +
            '                               class="form-control inp_1 kpRemark"/>' +
            '                    </div>'+
            '</div>')
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.kptd').remove()
        })
    }

    function insert1(){
        $('#kpcdsb').append('<div class="kpcdsb">' +
            '                <div class="div_3">' +
            '                    <label class="span_1">场地<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="场地"class="form-control inp_1 kpSite"/>' +
            '                    <span class="del" id="del">删除</span>'+
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">位置<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control cd college"/>学院' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control dong ridgepole"/>栋' +
            '                    <input type="text"  placeholder=""' +
            '                           class="form-control jshi classroomNum"/>号教室' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">设备及设施<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="设备及设施"' +
            '                           class="form-control inp_1 equiAndFacility"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">说明<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="说明"' +
            '                           class="form-control inp_1 explain"/>' +
            '                </div>'+
            '</div>');
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.kpcdsb').remove()
        })
    }

    function insert2(){
        $('#sxjydw').append('<div class="sxjydw">' +
            '                <div class="div_3">' +
            '                    <label class="span_1">单位名称<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="单位名称" class="form-control inp_1 dwName"/>' +
            '                    <span class="del" id="del">删除</span>'+
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">单位负责人<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="单位负责人"' +
            '                           class="form-control inp_1 dwUser"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="联系电话"' +
            '                           class="form-control inp_1 dwMobile"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">实习就业负责人<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="实习就业负责人"' +
            '                           class="form-control inp_1 jyUser"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">联系电话<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="联系电话"' +
            '                           class="form-control inp_1 jyMobile"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">拟招聘人数<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="拟招聘人数"' +
            '                           class="form-control inp_1 zpNum"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">拟招聘岗位<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="拟招聘岗位"' +
            '                           class="form-control inp_1 zpPost"/>' +
            '                </div>' +
            '                <div class="div_3">' +
            '                    <label class="span_1">薪酬<span style="color: #D52525">*</span>：</label>' +
            '                    <input type="text"  placeholder="薪酬"' +
            '                           class="form-control inp_1 emolument"/>' +
            '                </div>'+
            '</div>');
        $('.del').click(function () {
            $(this).parent('.div_3').parent('.sxjydw').remove()
        })
    }

    function saveCao(){
        nz_bg = window.setInterval("saveCao()", 300000);
        if ($('#name').val() == ""){
            layer.msg("单位名称不能为空");
            return false;
        }
        if ($('#numberOfExaminees').val() == ""){
            layer.msg("已批准的考核计划(人)不能为空");
            return false;
        }
        //------------------考评团队---------------------\\
        var teamList = [];
        $(".kptd").each(function (item, index) {
            var khName = $(this).find(".khName").val();
            var jobName = $(this).find(".jobName").val();
            var position = $(this).find('.position').val();
            var kpPost = $(this).find('.kpPost').val();
            var kpMobile = $(this).find('.kpMobile').val();
            var kpRemark = $(this).find('.kpRemark').val();
            teamList.push({khName: khName, jobName: jobName, position: position, kpPost:kpPost, kpMobile:kpMobile ,kpRemark:kpRemark});
        });

        //------------------考评场地设备---------------------\\
        var equipmentList = [];
        $(".kpcdsb").each(function (item, index) {
            var kpSite = $(this).find(".kpSite").val();
            var college = $(this).find(".college").val();
            var ridgepole = $(this).find('.ridgepole').val();
            var classroomNum = $(this).find('.classroomNum').val();
            var equiAndFacility = $(this).find('.equiAndFacility').val();
            var explain = $(this).find('.explain').val();
            equipmentList.push({kpSite: kpSite, college: college, ridgepole: ridgepole, classroomNum:classroomNum, equiAndFacility:equiAndFacility ,explain:explain});
        });

        //------------------实习就业单位汇总---------------------\\
        var employerList = [];
        $(".sxjydw").each(function (item, index) {
            var dwName = $(this).find(".dwName").val();
            var dwUser = $(this).find(".dwUser").val();
            var dwMobile = $(this).find('.dwMobile').val();
            var jyUser = $(this).find('.jyUser').val();
            var jyMobile = $(this).find('.jyMobile').val();
            var zpNum = $(this).find('.zpNum').val();
            var zpPost = $(this).find('.zpPost').val();
            var emolument = $(this).find('.emolument').val();
            employerList.push({dwName: dwName, dwUser: dwUser, dwMobile: dwMobile, jyUser:jyUser, jyMobile:jyMobile ,zpNum:zpNum, zpPost:zpPost, emolument:emolument});
        });
        ajaxToken1("/certificate/saveStation", 'POST', {
            orgId: $('#orgId').val(),
            name:$('#name').val(),
            numberOfExaminees:$('#numberOfExaminees').val(),
            enclosure:$('#enclosure').val(),
            cachet:$('#cachet').val(),
            team:JSON.stringify(teamList),
            equipment:JSON.stringify(equipmentList),
            employer:JSON.stringify(employerList),
            state: 4
        }, function (r) {
            if(r.code==0){
                layer.msg("自动保存成功",{offset:"rb"});
            }else{
                layer.confirm(r.msg);
                window.clearInterval(nz_bg)
            }
        })
    }

</script>
</html>